import operate from '@dfeidao/atom-nodejs/db/operate';




interface Message {
	menu_no: string;
	productid: string;
}
export default async function atom(msg: Message, action_id: string, session_id: string) {

	const systemid = '12';
	const { exec, del } = operate(action_id, session_id, systemid);
	if (!msg.menu_no) {
		return 'fail';
	}
	del('pub_menu', { menu_no: msg.menu_no, productid: msg.productid });
	const ret = await exec();
	if (ret.code === 1) {
		return 'success';
	} else {
		return 'fail';
	}
}
